﻿<!doctype html>
<html>
<head>
@model MvcApplication1.Models.ReportLadderModel

<meta charset="utf-8">
<title>Report Ladder</title>
<link rel="stylesheet" type="text/css" href="~/CSS/main.css">
<link rel="stylesheet" type="text/css" href="~/CSS/expandablelist.css">
<script src="~/Scripts/javascript.js"></script>
</head>
<body>
	<div id="main">
    	<div id="darkbar">
        	<p id="company">IntelliFleet</p>
            <img id="truckicon" src="~/Images/truckiconsmall.png">
            <p id="email">@ViewBag.Username</p>
            <span id ="triangle" onClick="toggleUserBox(0)"></span>
            <img id="trianglerotated" src="~/Images/trianglerotated.png" onClick="toggleUserBox(1)">
            <div id="userbox">
            	<a id="userlink1" href="~/Home/Settings"><p>Settings</p></a>
                <a id="userlink2" href="~/Home/AccountInformation"><p>Account Information</p></a>
                <a id="userlink3" href="~/SignIn/SignOut"><p>Sign Out</p></a>
            </div>
        </div>
        <div id="lightbar">
            <a href="~/Home/Index"><span id ="dailyupdates"></span></a>
            <a href="~/Home/FindReports"><span id ="findreports"></span></a>
            <a href="~/Home/ReportLadder"><span id ="reportladder"></span></a>
            <a href="~/Home/About"><span id ="about"></span></a>
            <a href="~/Home/Contact"><span id ="contact"></span></a>
        </div>
        <div id="description">
        	<p id="title">Report Ladder</p>
            <p id="summary">View all reports in your system with ease!</p>
        </div>
        <div id="expandablelist">
            <ol class="tree">
                @for (int i = 0; i < this.Model.years.Count(); i++)
                {
		        <li>
			        <label for="folder1">@this.Model.years[i]</label> <input type="checkbox" id="folder1" /> 
			        <ol>
                        @for (int a = 0; a < this.Model.months[i].Count(); a++)
                        {
				        <li>
					        <label for="subfolder1">@this.Model.ParseMonth(this.Model.months[i][a])</label> <input type="checkbox" id="subfolder1" /> 
					        <ol>
                                @for (int b = 0; b < this.Model.days[i][a].Count(); b++)
                                {
						        <li>
							        <label for="subsubfolder1">@this.Model.days[i][a][b]</label> <input type="checkbox" id="subsubfolder1" /> 
							        <ol>
                                        @foreach (var report in this.Model.GetRelevantReports(Convert.ToInt32(this.Model.years[i]), Convert.ToInt32(this.Model.months[i][a]), this.Model.days[i][a][b]))
                                        {
								            <li class="file"><a href="~/Home/ViewReport?name=@report.Name">@report.Name</a></li>
								        }
							        </ol>
						        </li>
                                }
					        </ol>
				        </li>
                        }
			        </ol>
		        </li>
                }
            </ol>
        </div>
    </div>
</body>
</html>